package com.nnnu.orange.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nnnu.orange.pojo.dto.ReservationsQueryDto;
import com.nnnu.orange.pojo.entity.Reservations;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nnnu.orange.pojo.vo.ReservationsQueryVO;
import com.nnnu.orange.pojo.vo.ReservationsVO;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 记录用户预约图书的信息 Mapper 接口
 * </p>
 *
 * @author zk
 * @since 2024-11-07
 */
@Mapper
public interface ReservationsMapper extends BaseMapper<Reservations> {

    /**
     * 分页查询
     *
     * @param page     page
     * @param queryDto dto
     * @param start    开始时间
     * @param end      结束时间
     * @return 分页数据
     */
    Page<ReservationsQueryVO> selectReservationsPage(Page<?> page, ReservationsQueryDto queryDto, LocalDateTime start, LocalDateTime end);


    /**
     * 查询预约详细信息
     *
     * @param id 预约id
     * @return 预约实体
     */
    ReservationsVO selectByReservationId(Integer id);


    List<Integer> selectUsersInReservations(@Param("userIds") List<Integer> userIds);

}
